package cn.biplam.common.client;

import java.rmi.RemoteException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.biplam.common.interfaces.PageExchangeServer;
import cn.biplam.common.tools.RMITOOLS;
import cn.biplam.common.wrapper.ErrorMessage;

/**
 * 页面交换请求客户端
 * @author WangSong 2009-9-23下午05:12:38
 * @version 1.0
 */
public abstract class PageExchange {
	
	/**
	 * 页面请求
	 * @param request 
	 * @param response
	 * @param pageName 页面名称
	 * @throws RemoteException
	 * @throws ErrorMessage
	 */
	public static String get(HttpServletRequest request, 
	        				 HttpServletResponse response,
	        				 String pageName) {
		String path = null;
		try {
			PageExchangeServer mPageExchangeServer = (PageExchangeServer)RMITOOLS.getInstance("PageExchangeServer");
			path = mPageExchangeServer.get(pageName); 
			
		} catch (ErrorMessage e) {
			e.printStackTrace();
		} catch (RemoteException e) {
			e.printStackTrace();;
		}
		return path;
	}
}
